<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Success Page</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
      background-color: #f4f4f4;
      margin: 0;
    }
    .success-container {
      background: red;
      padding: 2rem;
      border-radius: 8px;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
      width: 100%;
      max-width: 300px;
      text-align: center;
    }
    h1 {
      margin-top: 0;
      font-size: 24px;
      color: #333;
    }
    p {
      font-size: 18px;
      color: #333;
    }
    button {
      padding: 10px 20px;
      font-size: 16px;
      cursor: pointer;
    }
  </style>
</head>
<body>
<div class="success-container">
  <button type="button" id="hyperv-button">按钮</button>
</div>

<script>
  document.getElementById("hyperv-button").addEventListener("click", function() {
    fetch("/User/hyperv", {
      method: "GET"
    })
            .then(response => {
              if (response.ok) {
                return response.text();
              } else {
                throw new Error("请求失败");
              }
            })
            .then(data => {
              console.log("成功:", data);
              alert("Hyper-V 虚拟机创建成功！");
            })
            .catch(error => {
              console.error("失败:", error);
              alert("Hyper-V 虚拟机创建失败！");
            });
  });
</script>
</body>
</html>
